package echat.future.cn.echat.home.tools

import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.bumptech.glide.request.RequestOptions
import echat.future.cn.echat.R

/**
 *
 * Author  zhusx
 * Email   327270607@qq.com
 * Create  2018/10/16 20:45
 */
inline fun ImageView.loadHeaderImage(url: String) {
    Glide.with(context)
            .load(url)
            .apply(RequestOptions.circleCropTransform()
                    .placeholder(R.mipmap.ic_launcher)
                    .error(R.mipmap.ic_launcher)
                    .diskCacheStrategy(DiskCacheStrategy.NONE)
                    .skipMemoryCache(true))
            .into(this)
}